VER = Debug
ifeq ($(VER), Debug)
CPP_FLAGS = -g -Wall -DDEBUG -D_REENTRANT -D_USE_CURL_ -pthread
else
CPP_FLAGS = -g -Wall -O2 -D_REENTRANT -D_USE_CURL_ -pthread
endif
LD_FLAGS = ../../3rd/curl/libcurl.a ../../3rd/sqlite3/libsqlite3.a -ldl -rdynamic -pthread -lz -lrt

OUT_FILE = libserverbase.a
SRC_INCLUDE = -I ../xml2c_v2 -I ../sglib -I ../../../../proto/msg -I ../../3rd/pugixml -I ../../3rd/curl/include -I ../global -I ../../3rd/sqlite3 -I ../../3rd/jsoncpp/include -I ../activity
SRC_DIR = ./
#AR_FLAGS = rcs
AR_FLAGS = cq
CC  = gcc
CPP = g++
LD  = ld
AR  = ar

ALL_CPPFILES = $(wildcard *.cpp)
OBJS = $(ALL_CPPFILES:.cpp=.o)

all:$(OUT_FILE)

$(OUT_FILE):$(OBJS)
	$(AR) $(AR_FLAGS) $(OUT_FILE) $(OBJS) 
	
$(OBJS):%.o:%.cpp
	$(CPP) $(CPP_FLAGS) $(SRC_INCLUDE) -c $<

clean:
	rm -f $(OBJS) $(OUT_FILE)
